package io.renren.modules.sys.controller;

import java.util.Arrays;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.renren.common.vo.RV;
import io.renren.modules.sys.entity.Pos;
import io.renren.modules.sys.service.PosService;



/**
 * 岗位信息
 *
 * @author jingtang
 * @email sunlightcs@gmail.com
 * @date 2018-06-28 08:41:11
 */
@RestController
@RequestMapping("sys/pos")
public class PosController extends AbstractController{
    @Autowired
    private PosService posService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("sys:pos:list")
    public RV list(@RequestParam Map<String, Object> params){
        

        return RV.ok();
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{posId}")
    @RequiresPermissions("sys:pos:info")
    public RV info(@PathVariable("posId") String posId){
			Pos pos = posService.selectById(posId);

        return RV.ok(pos);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("sys:pos:save")
    public RV save(@RequestBody Pos pos){
			posService.insert(pos);

        return RV.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("sys:pos:update")
    public RV update(@RequestBody Pos pos){
			posService.updateById(pos);

        return RV.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("sys:pos:delete")
    public RV delete(@RequestBody String[] posIds){
			posService.deleteBatchIds(Arrays.asList(posIds));

        return RV.ok();
    }

}
